{% extends "personal_center/base.html" %}

{% block page_link %}
    <link rel="stylesheet" href="../../static/public_file/css/PersonnelChooser.css">
{% endblock %}


{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }

        .add_background {
            background: #A9A9A9;
        }

        tr {
            height: 35px;
        }

        th {
            text-align: center;
        }

        table {
            table-layout: fixed;
        }

        td:first-child, th:first-child {
            position: sticky;
            left: 0; /* 首行永远固定在左侧 */
            z-index: 1;
        }

        thead tr th {
            position: sticky;
            top: 0; /* 列首永远固定在头部  */
            background-color: #E8E8E8;
        }

        th:first-child {
            z-index: 2;
        }

        .li-class {
            list-style: none;
            margin-top: 2%;
            color: #0b0b0b;
            cursor: pointer;
        }

        #Table td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table1 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table2 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table3 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #t_table4 td {
            color: #0b0b0b;
            cursor: pointer;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table tr:hover {
            background: #E8E8E8;
            {#color: white;#}
        }

        #Table1 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #Table2 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #Table3 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #t_table4 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }

        .tab_top {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
        }

        .search {
            width: 95%;
            display: flex;
            float: right;
            margin: 5.5px 0;
            margin-right: 0.5%;
            /*border: 1px solid red;*/
        }

        .search input {
            vertical-align: middle;
            float: left;
        / / 左浮动 flex: 4;
            height: 29px;
            width: 77%;
            outline: none;
            border: 1px solid #0070c1;
            box-sizing: border-box;
        / / 盒子模型，怪异IE盒子模型，width = content + border * 2 + padding * 2 padding-left: 10 px;
            border-bottom-left-radius: 5px;
            border-top-left-radius: 5px;
        }

        .search button {
            float: right;
            flex: 1;
            height: 29px;
            line-height: 29px;
            background-color: #0070c1;
            color: white;
            border-style: none;
            outline: none;
            border-bottom-right-radius: 5px;
            border-top-right-radius: 5px;
        }

        .search button i {
            font-style: normal;
        }

        .search button:hover {
            font-size: 16px;
        }

        .shadow_tab {
            box-shadow: #01AAED 0 0 10px;
        }

        .shadow_tab_1 {
            width: 20%;
            height: 80px;
            border: #cfcfcf solid 1px;
            margin: 1%;
            display: inline-block;
            vertical-align: top;
            cursor: pointer;
        }

        .a_tag_cla {
            display: block;
            /*超出隐藏*/
            overflow: hidden;
            /*禁止换行*/
            white-space: nowrap;
            /*超出用省略号代替*/
            text-overflow: ellipsis;
        }

        #addForm {
            width: 800px;
            height: 620px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            display: none;
            z-index: 10100;
            font-size: 0;
        }

        /* 标题 */
        #title {
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 10px;
            height: 50px;
            color: #0b0b0b;
            cursor: move;
            /*border: #dfdfdf solid 1px;*/
            width: 100%;
            background: #f4f7fa;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
        }

        .search1 {
            width: 300px;
            display: flex;
            float: right;
            margin: 10px 0;
            margin-right: 1%;
            /*border: 1px solid red;*/
        }

        .search1 input {
            vertical-align: middle;
            float: left;
        / / 左浮动 flex: 4;
            height: 30px;
            width: 230px;
            outline: none;
            border: 1px solid #0070c1;
            box-sizing: border-box;
        / / 盒子模型，怪异IE盒子模型，width = content + border * 2 + padding * 2 padding-left: 10 px;
            border-bottom-left-radius: 3px;
            border-top-left-radius: 3px;
        }

        .search1 button {
            float: right;
            flex: 1;
            height: 30px;
            width: 70px;
            line-height: 30px;
            background-color: #0070c1;
            color: white;
            border-style: none;
            outline: none;
            border-bottom-right-radius: 3px;
            border-top-right-radius: 3px;
        }

        .search1 button i {
            font-style: normal;
        }

        .search1 button:hover {
            font-size: 16px;
        }

        tbody td {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

        .button_for_control {
            width: 90px;
            height: 30px;
            border: 1px solid #99D3F5;
            background: #D0EEFF;
            border-radius: 4px;
            letter-spacing: 0;
            line-height: 30px;
            color: #089bab;
        }
        #page_one button:hover {
            color: red;
        }
        .shade1 {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(36, 36, 36, 0.5);
            display: none;
            z-index: 10000;
        }
        #ThreeNavigation div {
            padding-left: 2%;
        }
        #selected-div div {
            line-height: 20px;
        }
    </style>
{% endblock %}


{% block right_content %}
    <div style="width: 100%;height: 40px;background: white;border-bottom: #A9A9A9 solid 0.5px;line-height: 40px;padding-left: 1%;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>

        <div id="XZ_tag" class="tab_top" onclick="change_mind('XZ')">
            审批详情
        </div>

        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="" style="width: 100px;float: right;text-align: center;margin-right: 1%;height: 40px;">
            <button id="" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
                    style="width: 100px;height: 30px;line-height: 27px;border: #1E90FF solid 1px;background: #1E90FF;color: white;margin-top: 5px;border-radius: 3px;">
                操作
            </button>
        </div>
        <div id="page_one" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
             style="z-index: 1000; position: absolute; width: 100px; height: auto;right: 0.9%; top: 80px;background: #FFFFFF; box-shadow: rgb(204 204 204) 2px 2px 10px;padding: 5px;display: none;">
            <button id="approve" onclick="online_tag()" class="button_for_control">
                审批
            </button>
            <button id="is_recall" onclick="operate_button(this.id)" class="button_for_control">
                撤回
            </button>

            <button id="is_cancel" onclick="operate_button(this.id)" class="button_for_control">
                作废
            </button>

            <button id="is_end" onclick="end_flow({{ con_obj.id }})" class="button_for_control">
                完结
            </button>

            <button id="is_stop" onclick="operate_button(this.id)" class="button_for_control">
                终止
            </button>
        </div>

        <div id="chose_hq" onclick="model_line()"
             style="float: right;width: 150px;text-align: center;height: 100%;display: none;">
            <button id="chose_but"
                    style="width: 100px;height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 1px;color: white;background-color: #1E90FF;line-height: 30px;">
                选择
            </button>
        </div>
    </div>

    <div id="appave-model" class="shade1">
        <div id="examine-model" style="width: 700px;background: white;left: 50%;top: 50%;position: absolute;transform: translate(-50%, -50%);">
            <div id="appave-title" style="width: 100%;height: 40px;border-bottom: #cfcfcf solid 1px;font-size: 14px;cursor: move;">
                <div style="width: 40%;height: 40px;line-height: 40px;text-align: left;padding-left: 1%;letter-spacing: 2px;float: left;">
                    审批
                </div>
                <div style="width: 59%;height: 40px;letter-spacing: 2px;float: left;">
                    <div onclick="close_models()" style="width: 40px;height: 40px;text-align: center;line-height: 40px;cursor: pointer;float: right;">
                        <i class="iconfont icon-quchu"></i>
                    </div>
                </div>
            </div>

            <div style="width: 100%;font-size: 14px;background: #E8E8E8;padding-top: 1%;">
                <div style="width: 98%;height: 150px;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;padding-right: 1%;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        基本信息
                    </div>
                    <div style="width: 100%;height: 125px;padding-left: 1%;">
                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">公文标题：</span>{{ con_obj.conference_memo_text }}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">公文编号：</span>{{ con_obj.document_number }}
                            </div>
                        </div>

                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">主送：</span>{{ con_obj.main_company }}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">抄送：</span>{{ con_obj.vice_company }}
                            </div>
                        </div>
                    </div>
                </div>

                <div style="width: 98%;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;margin-top: 1%;padding-right: 1%;padding-bottom: 20px;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        意见
                    </div>
                    <div style="width: 100%;">
                        <textarea id="opinion_detail" placeholder="请输入审批意见" style="width: 96%;height: 100px;margin-left: 2%;margin-top: 1%;border: #cfcfcf solid 1px;outline: none;font-size: 14px;" ></textarea>
                    </div>
                </div>

                <div style="width: 100%;height: 40px;background: white;margin-top: 1%;text-align: right;padding-right: 2%;">
                    <button onclick="summit_data('audit')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;" id="flow-agree">同意</button>
                    <button onclick="summit_data('draft')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;margin-left: 15px;" id="flow-back">退回修改</button>
                    <button id="abstention" onclick="summit_data('abstention')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;margin-left: 15px;">弃权</button>
                </div>
            </div>
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 95%;background: white;">
        <div style="width: 100%;height: 40px;line-height: 40px;text-align: center;">
            <h3 id="manuscript_title"></h3>
        </div>
        <hr>
        <div style="width: 100%;height: 93%;overflow: auto;">
            <div style="width: 90%;height: 40px;line-height: 40px;margin-left: 5%;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;padding-right: 1%;">
                申请详情
            </div>
            <div style="width: 100%;">
                <table style="width: 90%;margin-left: 5%;">
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            拟稿科室
                        </td>
                        <td id="ngks"
                            style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;"></td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            拟稿人
                        </td>
                        <td id="ngr"
                            style="width: 20%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;"></td>
                        <td style="width: 10%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            文号
                        </td>
                        <td id="gwwh"
                            style="width: 25%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;outline: none;border-top: none;"></td>
                    </tr>
                </table>
                <table style="width: 90%;margin-left: 5%;">
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题
                        </td>
                        <td id="gwbt"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr id="PrintingCopy" style="width: 100%;display: none;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            印&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份
                        </td>
                        <td id="yf"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送
                        </td>
                        <td id="zs"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            抄&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送
                        </td>
                        <td id="cs"
                            style="width: 85%;height: 40px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 1%;"></td>
                    </tr>
                    <tr id="gist" style="width: 100%;display: none">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">依&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;据</td>
                        <td id="yj" colspan="5" style="width: 85%;height: 40px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 1%;"></td>
                    </tr>
                    {% if audit_list|length %}
                        {% for foo in audit_list %}
                            <tr>
                                <td colspan="6" style="width: 100%;height: 40px;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cfcfcf solid 1px;">{{ foo.ApproveText }}</td>
                            </tr>
                            {% if 'C/D' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 3px;">拟&nbsp;&nbsp;&nbsp;&nbsp;稿&nbsp;&nbsp;&nbsp;&nbsp;人</td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'C/D' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'PRG' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.2px;">
                                        {% if con_obj.type == 'a' or con_obj.type == 'c' or con_obj.type == 'g' or con_obj.type == 'i' %}
                                            党委办公室初审
                                        {% else %}
                                            医院办公室初审
                                        {% endif %}
                                    </td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'PRG' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'YB/DB' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        {% if con_obj.type == 'a' or con_obj.type == 'c' or con_obj.type == 'g' or con_obj.type == 'i' %}
                                            党委办公室核稿
                                        {% else %}
                                            医院办公室核稿
                                        {% endif %}
                                    </td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'YB/DB' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'YBL/DBL' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 1.2px;">分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;&nbsp;导</td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'YBL/DBL' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'B' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.7px;">会&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签</td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'B' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div style="border-bottom: 1px solid rgb(204, 204, 204); width: 100%;">
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'YZ/SJ' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.7px;">签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'YZ/SJ' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}

                            {% if 'BGS' in foo %}
                                <tr style="width: 100%;">
                                    <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.1px;">办&nbsp;公&nbsp;室&nbsp;盖&nbsp;章</td>
                                    <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                        <div style="width: 100%; position: relative; display: table;">
                                            {% for k,v in foo.items %}
                                                {% if k == 'BGS' %}
                                                    {% for item in v %}
                                                        {% if item.state != 'unaudit' %}
                                                            <div style="width: 100%;line-height: 20px;position: relative;">
                                                                <span>{{ item.state_display }}</span>
                                                                <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                            </div>
                                                            <div>
                                                                <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                                <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                {% endif %}
                                            {% endfor %}
                                        </div>
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                    {% else %}
                        <tr>
                            <td colspan="6" style="width: 100%;height: 40px;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cfcfcf solid 1px;">审批详情</td>
                        </tr>
                        {% if 'C/D' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 3px;">拟&nbsp;&nbsp;&nbsp;&nbsp;稿&nbsp;&nbsp;&nbsp;&nbsp;人</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'C/D' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'PRG' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    {% if con_obj.type == 'a' or con_obj.type == 'c' or con_obj.type == 'g' or con_obj.type == 'i' %}
                                        党委办公室初审
                                    {% else %}
                                        医院办公室初审
                                    {% endif %}
                                </td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'PRG' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'YB/DB' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    {% if con_obj.type == 'a' or con_obj.type == 'c' or con_obj.type == 'g' or con_obj.type == 'i' %}
                                        党委办公室核稿
                                    {% else %}
                                        医院办公室核稿
                                    {% endif %}
                                </td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'YB/DB' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'YBL/DBL' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 1.2px;">分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;&nbsp;导</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 1%;padding-right: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'YBL/DBL' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'B' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.7px;">会&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'B' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'YZ/SJ' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2.7px;">签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'YZ/SJ' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'BGS' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 2px;">办&nbsp;公&nbsp;室&nbsp;盖&nbsp;章</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'BGS' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span>{{ item.state_display }}</span>
                                                            <span style="margin-left: 3%;white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'end' in audit_dic %}
                            <tr style="width: 100%;">
                                <td style="width: 15%;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">流&nbsp;&nbsp;&nbsp;程&nbsp;&nbsp;&nbsp;完&nbsp;&nbsp;&nbsp;结</td>
                                <td colspan="5" style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;padding-right: 1%;padding-left: 1%;">
                                    <div style="width: 100%; position: relative; display: table;">
                                        {% for k,v in audit_dic.items %}
                                            {% if k == 'end' %}
                                                {% for item in v %}
                                                    {% if item.state != 'unaudit' %}
                                                        <div style="width: 100%;line-height: 20px;position: relative;">
                                                            <span style="white-space: pre-wrap;">{{ item.audit_note }}</span>
                                                        </div>
                                                        <div>
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                            <div style="right: 0px; width: 300px; height: 60px; color: rgb(11, 11, 11); float: right; text-align: right; line-height: 70px;">{{ item.audit_time }}</div>
                                                        </div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                </td>
                            </tr>
                        {% endif %}
                    {% endif %}
                </table>
            </div>

        </div>
    </div>

    <div id="XZ" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 15%">
            <div id="tab_4" class="shadow_tab shadow_tab_1" onclick="Change_tab(4)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/流程审批.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 id="approve_people_num" style="color: #01AAED;"></h5>
                    </div>
                    <div style="height: 25px;">审批详情</div>
                </div>
            </div>

            <div id="tab_1" class="shadow_tab_1" onclick="Change_tab(1)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/1人员管理.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #01AAED;" id="total_number"></h5>
                    </div>
                    <div style="height: 25px;">收阅人次</div>
                </div>
            </div>

            <div id="tab_2" class="shadow_tab_1" onclick="Change_tab(2)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/查看.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #00b7ee;" id="read_number"></h5>
                    </div>
                    <div style="height: 25px;">已查看</div>
                </div>
            </div>

            <div id="tab_3" class="shadow_tab_1" onclick="Change_tab(3)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/未查看.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #e02107;" id="unread_number"></h5>
                    </div>
                    <div style="height: 25px;">未查看</div>
                </div>
            </div>
        </div>

        <div style="width: 100%;height: 80%;margin-top: 10px;">
            <div id="tab_four" style="width: 100%;height: 100%;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 10%;">节点</th>
                        <th style="width: 10%;">审批人</th>
                        <th style="width: 20%;">审批结果</th>
                        <th style="width: 20%;">审批意见</th>
                        <th style="width: 20%;">审批时间</th>
                        <th style="width: 20%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table">
                    </tbody>
                </table>
            </div>
            <div id="tab_one" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table1">
                    </tbody>
                </table>
            </div>
            <div id="tab_two" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table2">
                    </tbody>
                </table>
            </div>
            <div id="tab_three" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table3">
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">

            </div>
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="staff-select" class="shade">
        <div id="staff-model" style="width: 100%;height: 100%;position: absolute;">
            <div style="width: 900px;height: 500px;background: #F5F5F5;z-index: 10000;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
                <div id="staff-box" style="width: 100%;height: 40px;background: #f4f7fa;cursor: move;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 40px;font-size: 14px;">
                        选择人员
                    </div>
                    <span onclick="close_model()" style="float: right;padding-right: 2%;cursor: pointer;line-height: 38px;">
                        <i class="iconfont icon-quchu"></i>
                    </span>
                </div>
                <div style="height: 460px;width: 100%;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 70px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div id="dep" class="navigation navigation_color" onclick="change_navigation(this)">部门</div>
                        <div id="limits" class="navigation" onclick="change_navigation(this)">权限</div>
                        <div id="fun" class="navigation" onclick="change_navigation(this)">职能</div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input id="SearchDep" onkeydown="SearchDepartment()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 95%;">
                        </div>
                        <div id="SecondaryNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;">
                            <input type="checkbox" id="select-all" onclick="SelectAll(this)">
                            <input id="SearchPeo" onkeydown="SearchProple()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 87%;">
                        </div>
                        <div id="ThreeNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 410px;height: 100%;display: inline-block;vertical-align: top;overflow: auto">
                        <div style="width: 100%;height: 410px;">
                            <div id="already_select_people" style="width: 100%;height: 100%;display: inline-block;vertical-align: top;">
                                <div id="selected-number" style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选0人
                                </div>
                                <div id="selected-div" style="width: 100%;font-size: 14px;height: 370px;overflow: auto;">

                                </div>
                            </div>
                            <div id="upload_distribution" style="width: 48%;height: 100%;vertical-align: top;display: none;">
                                <div style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                                    上传文件
                                </div>
                                <div style="width: 100%;font-size: 14px;height: 370px;overflow: auto;">
                                    <div style="width: 100%;height: 150px;">
                                        <a href="javascript:;" class="file" style="margin-left: 35px;">
                                            <img src="../../static/personal_center/img/加号_o.png" alt="" onclick="onclick_upload_file()" style="width: 100px;height: 100px;vertical-align: baseline;">
                                            <input type="file" name="regular_main_body" id="regular_main_body" onchange="upload_accessory('file2', 'regular_main', 'regular_main_body')">
                                        </a>
                                        <div id="upload_file_list" style="width: 100%;padding-top: 2%;"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div style="width: 100%;font-size: 14px;height: 40px;text-align: center;">
                            <button onclick="IdentifyPersonnel()" id="model-affirm" style="width: 100px;height: 30px;line-height: 25px;text-align: center;letter-spacing: 5px;border-radius: 3px;border: #cfcfcf solid 1px;font-size: 14px;cursor: pointer;margin-top: 10px;">完成</button>
                            <button onclick="close_model()" style="margin-left: 15px;width: 100px;height: 30px;line-height: 25px;text-align: center;color: #0abb78;letter-spacing: 5px;border-radius: 3px;font-size: 14px;border: #cfcfcf solid 1px;cursor: pointer;margin-top: 10px;">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}


{% block script %}
    <script src="../../static/public_file/js/PersonnelChoosersNew.js" type="text/javascript" charset="gb2312"></script>
    <script>
        window.onload = function () {
            document.getElementById("sponsor").className = "add_class";
            document.getElementById("personage").className = "add-nav-active";
            request_fun();
        };

        let appave_title = document.querySelector("#appave-title");
        let examine_model = document.querySelector("#examine-model");

        appave_title.addEventListener("mousedown", function (e) {
            let x = e.pageX - examine_model.offsetLeft;
            let y = e.pageY - examine_model.offsetTop;
            document.addEventListener("mousemove", move);

            function move(e) {
                examine_model.style.left = e.pageX - x + 'px';
                examine_model.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        function request_fun() {
            var docement_id = window.location.href.split('id=')[1];
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('get', "/administrative/conference_memo_detail_view?id=" + docement_id, true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send();
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        if (JsonDate["data_dic"]["state"] === "会签") {
                            document.getElementById("abstention").style.display="inline-block";
                            {#document.getElementById("abs_value").style.display="inline-block";#}
                        }else {
                            document.getElementById("abstention").style.display="none";
                            {#document.getElementById("abs_value").style.display="none";#}
                        }
                        if (JsonDate["data_dic"]['is_stop'] === 'false') {
                            document.getElementById('is_stop').style.display = 'none';
                            document.getElementById('is_end').style.display = 'none';
                        }
                        if (JsonDate["data_dic"]['is_cancel'] === 'false') {
                            document.getElementById('is_cancel').style.display = 'none';
                        }
                        if (JsonDate["data_dic"]['is_recall'] === 'false') {
                            document.getElementById('is_recall').style.display = 'none';
                        }
                        document_number = JsonDate["data_dic"]["number"];
                        if (JsonDate["data_dic"]["state"] === "分发") {
                            document.getElementById("chose_hq").style.display = "table";
                            document.getElementById("approve").style.display = "none";
                            document.getElementById("chose_but").innerText = "分发";
                            if (JsonDate["data_dic"]["type"] === 'e') {
                                document.getElementById("model-affirm").setAttribute("onclick", "send_all()");
                            } else {
                                document.getElementById("model-affirm").setAttribute("onclick", "distribute()");
                                document.getElementById("already_select_people").style.width = '50%';
                                document.getElementById("upload_distribution").style.display = 'inline-block';
                                document.getElementById("already_select_people").style.borderRight = '#cfcfcf solid 1px';
                            }
                        }
                        if (JsonDate["data_dic"]["type"] === 'a') {
                            document.getElementById("manuscript_title").innerText = "党委会议纪要";
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                        } else if (JsonDate["data_dic"]["type"] === 'b') {
                            document.getElementById("manuscript_title").innerText = "院长办公会会议纪要";
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                        } else if (JsonDate["data_dic"]["type"] === 'c') {
                            document.getElementById("manuscript_title").innerText = "党委专题会议纪要";
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                        } else if (JsonDate["data_dic"]["type"] === 'd') {
                            document.getElementById("manuscript_title").innerText = "院长办公会专题会议纪要";
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                        } else if (JsonDate["data_dic"]["type"] === 'e') {
                            document.getElementById("manuscript_title").innerText = "行政例会简报";
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                            {#document.getElementById("hq_tr").style.display = "none";#}
                        } else if (JsonDate["data_dic"]["type"] === 'f') {
                            document.getElementById("manuscript_title").innerText = "行政公文";
                            {#document.getElementById("hq_tr").style.display = "none";#}
                            document.getElementById("PrintingCopy").style.display="table-row";
                            document.getElementById("gist").style.display='table-row';
                            document.getElementById("yj").innerText=JsonDate['data_dic']["gist"];
                        } else if (JsonDate["data_dic"]["type"] === 'g') {
                            document.getElementById("manuscript_title").innerText = "党委公文";
                            {#document.getElementById("hq_tr").style.display = "none";#}
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                            document.getElementById("gist").style.display='table-row';
                            document.getElementById("yj").innerText=JsonDate['data_dic']["gist"];
                        } else if (JsonDate["data_dic"]["type"] === 'i') {
                            document.getElementById("manuscript_title").innerText = "京医团总支发文";
                            {#document.getElementById("hq_tr").style.display = "none";#}
                            {#document.getElementById("StampDistribution").style.display = "none";#}
                        } else {
                            document.getElementById("manuscript_title").innerText = "行政公文";
                            {#document.getElementById("hq_tr").style.display = "none";#}
                            document.getElementById("PrintingCopy").style.display="table-row";
                            document.getElementById("gist").style.display='table-row';
                            document.getElementById("yj").innerText=JsonDate['data_dic']["gist"];
                        }

                        if (JsonDate["data_dic"]["state"] === "指定会签人员") {
                            if (JsonDate["data_dic"]['type'] === "a" || JsonDate["data_dic"]['type'] === "b" || JsonDate["data_dic"]['type'] === "c" || JsonDate["data_dic"]['type'] === "d") {
                                document.getElementById("chose_hq").style.display = "table";
                                document.getElementById("approve").style.display = "none";
                                {#document.getElementById("modal-title1").innerText = "选择会签人员";#}
                            }
                        }

                        document.getElementById("ngks").innerText = JsonDate["data_dic"]["drafter_company"];
                        document.getElementById("ngks").title = JsonDate["data_dic"]["drafter_company"];
                        document.getElementById("ngr").innerText = JsonDate["data_dic"]["drafter"];
                        document.getElementById("gwwh").innerText = JsonDate["data_dic"]["document_number"];
                        document.getElementById("gwbt").innerText = JsonDate["data_dic"]["conference_memo_text"];
                        document.getElementById("yf").innerText = JsonDate["data_dic"]["servings"];
                        document.getElementById("zs").innerText = JsonDate["data_dic"]["main_company"];
                        document.getElementById("cs").innerText = JsonDate["data_dic"]["vice_company"];

                        if (JsonDate["data_dic"]['file_list'].length) {
                            document.getElementById("embed_file").setAttribute("src", JsonDate["data_dic"]['file_list'][0]["file_path"].replace("mediaTopics", "/media/Topics"));
                        }

                        var yt_zhengwen = document.getElementById("yt_zhengwen");
                        for (var d = 0; d < JsonDate["data_dic"]['file_list'].length; d++) {
                            if (JsonDate["data_dic"]['file_list'][d]["file_type"] === "0") {
                                var div_tag = document.createElement("div");
                                div_tag.style.width = "100%";
                                div_tag.style.height = "40px";
                                div_tag.style.paddingLeft = "2%";
                                div_tag.style.lineHeight = "40px";
                                var a_tag = document.createElement("a");
                                a_tag.setAttribute("href", "#");
                                a_tag.className = "a_tag_cla";
                                a_tag.innerText = JsonDate["data_dic"]['file_list'][d]["file_name"];
                                a_tag.setAttribute("onclick", "chage_yulan(this, '" + JsonDate["data_dic"]['file_list'][d]["file_path"].replace("mediaTopics", "/media/Topics") + "')");
                                div_tag.appendChild(a_tag);
                                yt_zhengwen.appendChild(div_tag);
                            }
                        }


                        CreateMyMine(JsonDate["data_dic"]["audit_list"], JsonDate["data_dic"]["type"]);
                        if (!JsonDate["data_dic"]["recive_people"].length) {
                            document.getElementById("unread_number").innerText = "0 人";
                            document.getElementById("read_number").innerText = "0 人";
                            document.getElementById("total_number").innerText = "0 人";
                        } else {
                            create_recive_people(JsonDate["data_dic"]["recive_people"]);
                        }
                    }
                }
            };
        }

        function close_models1() {
            document.getElementById("addForm").style.display = "none";
        }

        function addform_block() {
            document.getElementById("addForm").style.display = "table-row";
        }

        function page_zhanshi() {
            document.getElementById('page_one').style.display = 'inline-block';
        }

        function page_yincang() {
            document.getElementById('page_one').style.display = 'none';
        }

        function CreateMyMine(json_data, flow_type) {
            if (json_data.length === 0) {
                document.getElementById("img-display").style.display = "inline-block";
            }
            deltr();
            var my_mine_body = document.getElementById("Table");
            var approve_number = 0
            if (json_data.hasOwnProperty("C/D")) {
                for (var cd = 0; cd < json_data["C/D"].length; cd++) {
                    var cd_mine = document.createElement("tr");
                    var cdMind = document.createElement("td");
                    var cdMind1 = document.createElement("td");
                    var cdMind2 = document.createElement("td");
                    var cdMind3 = document.createElement("td");
                    var cdMind4 = document.createElement("td");
                    var cdMind5 = document.createElement("td");
                    cdMind.innerHTML = "拟稿人";
                    cdMind.style.textAlign = "center";
                    cdMind1.innerHTML = json_data["C/D"][cd]["audit_user"];
                    cdMind1.style.textAlign = "center";
                    cdMind2.innerHTML = json_data["C/D"][cd]["state"];
                    cdMind2.style.textAlign = "center";
                    cdMind3.innerHTML = json_data["C/D"][cd]["audit_note"];
                    cdMind3.style.textAlign = "center";
                    cdMind4.innerHTML = json_data["C/D"][cd]["audit_time"];
                    cdMind4.style.textAlign = "center";
                    if (json_data["C/D"][cd]["signature_picture"]) {
                        cdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["C/D"][cd]["signature_picture"] + "'>";
                        cdMind5.style.textAlign = "center";
                    } else {
                        cdMind5.innerHTML = "";
                        cdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    cd_mine.appendChild(cdMind);
                    cd_mine.appendChild(cdMind1);
                    cd_mine.appendChild(cdMind2);
                    cd_mine.appendChild(cdMind3);
                    cd_mine.appendChild(cdMind4);
                    cd_mine.appendChild(cdMind5);
                    my_mine_body.appendChild(cd_mine);
                }
            }

            if (json_data.hasOwnProperty("PRG")) {
                for (var prg = 0; prg < json_data["PRG"].length; prg++) {
                    var prg_mine = document.createElement("tr");
                    var prgMind = document.createElement("td");
                    var prgMind1 = document.createElement("td");
                    var prgMind2 = document.createElement("td");
                    var prgMind3 = document.createElement("td");
                    var prgMind4 = document.createElement("td");
                    var prgMind5 = document.createElement("td");
                    if (flow_type === 'a' || flow_type === 'c' || flow_type === 'g' || flow_type === 'i') {
                        prgMind.innerHTML = "党委办公室初审";
                    }else {
                        prgMind.innerHTML = "医院办公室初审";
                    }
                    prgMind.style.textAlign = "center";
                    prgMind1.innerHTML = json_data["PRG"][prg]["audit_user"];
                    prgMind1.style.textAlign = "center";
                    prgMind2.innerHTML = json_data["PRG"][prg]["state"];
                    prgMind2.style.textAlign = "center";
                    prgMind3.innerHTML = json_data["PRG"][prg]["audit_note"];
                    prgMind3.style.textAlign = "center";
                    prgMind4.innerHTML = json_data["PRG"][prg]["audit_time"];
                    prgMind4.style.textAlign = "center";
                    if (json_data["PRG"][prg]["signature_picture"]) {
                        prgMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["PRG"][prg]["signature_picture"] + "'>";
                        prgMind5.style.textAlign = "center";
                    } else {
                        prgMind5.innerHTML = "";
                        prgMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    prg_mine.appendChild(prgMind);
                    prg_mine.appendChild(prgMind1);
                    prg_mine.appendChild(prgMind2);
                    prg_mine.appendChild(prgMind3);
                    prg_mine.appendChild(prgMind4);
                    prg_mine.appendChild(prgMind5);
                    my_mine_body.appendChild(prg_mine);
                }
            }

            if (json_data.hasOwnProperty("YB/DB")) {
                for (var A = 0; A < json_data["YB/DB"].length; A++) {
                    var tr_mine = document.createElement("tr");
                    var TdMind = document.createElement("td");
                    var TdMind1 = document.createElement("td");
                    var TdMind2 = document.createElement("td");
                    var TdMind3 = document.createElement("td");
                    var TdMind4 = document.createElement("td");
                    var TdMind5 = document.createElement("td");
                    if (flow_type === 'a' || flow_type === 'c' || flow_type === 'g' || flow_type === 'i') {
                        TdMind.innerHTML = "党委办公室核稿";
                    }else {
                        TdMind.innerHTML = "医院办公室核稿";
                    }
                    TdMind.style.textAlign = "center";
                    TdMind1.innerHTML = json_data["YB/DB"][A]["audit_user"];
                    TdMind1.style.textAlign = "center";
                    TdMind2.innerHTML = json_data["YB/DB"][A]["state"];
                    TdMind2.style.textAlign = "center";
                    TdMind3.innerHTML = json_data["YB/DB"][A]["audit_note"];
                    TdMind3.style.textAlign = "center";
                    TdMind4.innerHTML = json_data["YB/DB"][A]["audit_time"];
                    TdMind4.style.textAlign = "center";
                    if (json_data["YB/DB"][A]["signature_picture"]) {
                        TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["YB/DB"][A]["signature_picture"] + "'>";
                        TdMind5.style.textAlign = "center";
                    } else {
                        TdMind5.innerHTML = "";
                        TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    tr_mine.appendChild(TdMind);
                    tr_mine.appendChild(TdMind1);
                    tr_mine.appendChild(TdMind2);
                    tr_mine.appendChild(TdMind3);
                    tr_mine.appendChild(TdMind4);
                    tr_mine.appendChild(TdMind5);
                    my_mine_body.appendChild(tr_mine);
                }

            }

            if (json_data.hasOwnProperty("YBL/DBL")) {
                for (var B = 0; B < json_data["YBL/DBL"].length; B++) {
                    var fg_mine = document.createElement("tr");
                    var fg_TdMind = document.createElement("td");
                    var fg_TdMind1 = document.createElement("td");
                    var fg_TdMind2 = document.createElement("td");
                    var fg_TdMind3 = document.createElement("td");
                    var fg_TdMind4 = document.createElement("td");
                    var fg_TdMind5 = document.createElement("td");
                    fg_TdMind.innerHTML = "分管领导";
                    fg_TdMind.style.textAlign = "center";
                    fg_TdMind1.innerHTML = json_data["YBL/DBL"][B]["audit_user"];
                    fg_TdMind1.style.textAlign = "center";
                    fg_TdMind2.innerHTML = json_data["YBL/DBL"][B]["state"];
                    fg_TdMind2.style.textAlign = "center";
                    fg_TdMind3.innerHTML = json_data["YBL/DBL"][B]["audit_note"];
                    fg_TdMind3.style.textAlign = "center";
                    fg_TdMind4.innerHTML = json_data["YBL/DBL"][B]["audit_time"];
                    fg_TdMind4.style.textAlign = "center";
                    if (json_data["YBL/DBL"][B]["signature_picture"]) {
                        fg_TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["YBL/DBL"][B]["signature_picture"] + "'>";
                        fg_TdMind5.style.textAlign = "center";
                    } else {
                        fg_TdMind5.innerHTML = "";
                        fg_TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    fg_mine.appendChild(fg_TdMind);
                    fg_mine.appendChild(fg_TdMind1);
                    fg_mine.appendChild(fg_TdMind2);
                    fg_mine.appendChild(fg_TdMind3);
                    fg_mine.appendChild(fg_TdMind4);
                    fg_mine.appendChild(fg_TdMind5);
                    my_mine_body.appendChild(fg_mine);
                }

            }

            if (json_data.hasOwnProperty("B")) {
                for (var C = 0; C < json_data["B"].length; C++) {
                    var HQ_mine = document.createElement("tr");
                    var HQ_TdMind = document.createElement("td");
                    var HQ_TdMind1 = document.createElement("td");
                    var HQ_TdMind2 = document.createElement("td");
                    var HQ_TdMind3 = document.createElement("td");
                    var HQ_TdMind4 = document.createElement("td");
                    var HQ_TdMind5 = document.createElement("td");
                    HQ_TdMind.innerHTML = "会签";
                    HQ_TdMind.style.textAlign = "center";
                    HQ_TdMind1.innerHTML = json_data["B"][C]["audit_user"];
                    HQ_TdMind1.style.textAlign = "center";
                    HQ_TdMind2.innerHTML = json_data["B"][C]["state"];
                    HQ_TdMind2.style.textAlign = "center";
                    HQ_TdMind3.innerHTML = json_data["B"][C]["audit_note"];
                    HQ_TdMind3.style.textAlign = "center";
                    HQ_TdMind4.innerHTML = json_data["B"][C]["audit_time"];
                    HQ_TdMind4.style.textAlign = "center";
                    if (json_data["B"][C]["signature_picture"]) {
                        HQ_TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["B"][C]["signature_picture"] + "'>";
                        HQ_TdMind5.style.textAlign = "center";
                    } else {
                        HQ_TdMind5.innerHTML = "";
                        HQ_TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    HQ_mine.appendChild(HQ_TdMind);
                    HQ_mine.appendChild(HQ_TdMind1);
                    HQ_mine.appendChild(HQ_TdMind2);
                    HQ_mine.appendChild(HQ_TdMind3);
                    HQ_mine.appendChild(HQ_TdMind4);
                    HQ_mine.appendChild(HQ_TdMind5);
                    my_mine_body.appendChild(HQ_mine);
                }

            }

            if (json_data.hasOwnProperty("YZ/SJ")) {
                for (var D = 0; D < json_data["YZ/SJ"].length; D++) {
                    var QF_mine = document.createElement("tr");
                    var QF_TdMind = document.createElement("td");
                    var QF_TdMind1 = document.createElement("td");
                    var QF_TdMind2 = document.createElement("td");
                    var QF_TdMind3 = document.createElement("td");
                    var QF_TdMind4 = document.createElement("td");
                    var QF_TdMind5 = document.createElement("td");
                    QF_TdMind.innerHTML = "签发";
                    QF_TdMind.style.textAlign = "center";
                    QF_TdMind1.innerHTML = json_data["YZ/SJ"][D]["audit_user"];
                    QF_TdMind1.style.textAlign = "center";
                    QF_TdMind2.innerHTML = json_data["YZ/SJ"][D]["state"];
                    QF_TdMind2.style.textAlign = "center";
                    QF_TdMind3.innerHTML = json_data["YZ/SJ"][D]["audit_note"];
                    QF_TdMind3.style.textAlign = "center";
                    QF_TdMind4.innerHTML = json_data["YZ/SJ"][D]["audit_time"];
                    QF_TdMind4.style.textAlign = "center";
                    if (json_data["YZ/SJ"][D]["signature_picture"]) {
                        QF_TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["YZ/SJ"][D]["signature_picture"] + "'>";
                        QF_TdMind5.style.textAlign = "center";
                    } else {
                        QF_TdMind5.innerHTML = "";
                        QF_TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    QF_mine.appendChild(QF_TdMind);
                    QF_mine.appendChild(QF_TdMind1);
                    QF_mine.appendChild(QF_TdMind2);
                    QF_mine.appendChild(QF_TdMind3);
                    QF_mine.appendChild(QF_TdMind4);
                    QF_mine.appendChild(QF_TdMind5);
                    my_mine_body.appendChild(QF_mine);
                }

            }
            document.getElementById("approve_people_num").innerText = String(approve_number) + " 人";
        }

        function create_recive_people(jsonData) {
            var total_number = 0;
            var read_number = 0;
            var unread_number = 0;
            var Table1 = document.getElementById("Table1");
            var Table2 = document.getElementById("Table2");
            var Table3 = document.getElementById("Table3");

            for (var i = 0; i < jsonData.length; i++) {
                if (jsonData[i]["state"] === "未读") {
                    unread_number += 1;
                    no_recive(jsonData[i], Table3)
                } else {
                    read_number += 1
                    recive_people(jsonData[i], Table2)
                }
                total_number += 1
                document.getElementById("unread_number").innerText = String(unread_number) + " 人";
                document.getElementById("read_number").innerText = String(read_number) + " 人";
                document.getElementById("total_number").innerText = String(total_number) + " 人";
                all_recive(jsonData[i], Table1)
            }
        }

        // 所有收阅人
        function all_recive(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            if (recive_data["state"] === "未读") {
                td1.innerHTML = "未收阅";
            } else {
                td1.innerHTML = "已收阅";
            }
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (!recive_data["signature_picture"] && recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["signature_picture"];
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 已收阅
        function recive_people(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            if (recive_data["state"] === "未读") {
                td1.innerHTML = "未收阅";
            } else {
                td1.innerHTML = "已收阅";
            }
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (!recive_data["signature_picture"] && recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["signature_picture"];
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 未收阅
        function no_recive(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            if (recive_data["state"] === "未读") {
                td1.innerHTML = "未收阅";
            } else {
                td1.innerHTML = "已收阅";
            }
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (!recive_data["signature_picture"] && recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["signature_picture"];
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 删除列表
        function deltr() {
            var tb = document.getElementById('Table');
            var rowNum = tb.rows.length;
            for (i = 0; i < rowNum; i++) {
                tb.deleteRow(i);
                rowNum = rowNum - 1;
                i = i - 1;
            }
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("XZ_tag").className = "tab_top";
                document.getElementById("XZ").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            } else if (ele_id === "XZ") {
                document.getElementById("XZ").style.display = "inline-block";
                document.getElementById("XZ_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            } else {
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("XZ_tag").className = "tab_top";
                document.getElementById("XZ").style.display = "none";
            }
        }

        function online_tag() {
            document.getElementById("appave-model").style.display = "table-cell";
        }

        function close_models() {
            document.getElementById("appave-model").style.display = "none";
        }

        function summit_data(approve) {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var audit_note = document.getElementById("opinion_detail").value;

            if (approve === "draft") {
                if (!audit_note) {
                    alert("不同意请填写理由！");
                    return false
                }
            }
            if (approve === "abstention") {
                if (!audit_note) {
                    alert("弃权请填写理由！");
                    return false
                }
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/conference_memo_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&state=" + String(approve) + "&audit_note=" + String(audit_note));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        // 删除列表
        function deltr1() {
            var tb = document.getElementById('t_table2');
            var rowNum = tb.rows.length;
            for (i = 0; i < rowNum; i++) {
                tb.deleteRow(i);
                rowNum = rowNum - 1;
                i = i - 1;
            }
        }

        function IdentifyPersonnel() {
            var present_id = '{{ con_obj.id }}';
            var prople_list = [];
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            for (var i=0; i<selected_personnel_list.length; i++) {
                prople_list.push(selected_personnel_list[i].innerText)
            }

            var executor_people = prople_list.join();
            var xhr = new XMLHttpRequest();
            document.getElementById("loading").style.display = "inline-block";
            xhr.open('post', "/administrative/conference_memo_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&state=audit" + "&audit_note=&hq_people=" + String(executor_people));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            close_model();
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function distribute() {
            var regular_main = document.getElementById("upload_file_list");
            if (!regular_main.childNodes.length) {
                alert("请上传公文！");
                return false
            }
            document.getElementById("loading").style.display = "inline-block";
            var present_id = '{{ con_obj.id }}';
            var people_list = [];
            var checked_label = document.getElementsByClassName("selected-personnel");
            for (var j = 0; j < checked_label.length; j++) {
                people_list.push(checked_label[j].innerText)
            }
            close_model();
            var executor_people = people_list.join();
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/conference_memo_receive");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&receive_people=" + String(executor_people));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("分发成功！");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=公文管理&folw=行政例会简报&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function Change_tab(change_number) {
            if (change_number === 1) {
                document.getElementById("tab_1").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_one").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else if (change_number === 2) {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_two").style.display = "inline-block";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else if (change_number === 3) {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_three").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_4").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_four").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
            }
        }

        function send_all() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var people_list = [];
            var checked_label = document.getElementsByClassName("selected-personnel");
            for (var j = 0; j < checked_label.length; j++) {
                people_list.push(checked_label[j].innerText)
            }
            close_model();
            var executor_people = people_list.join();
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/conference_memo_receive");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&receive_people=" + String(executor_people));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("分发成功！");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=公文管理&folw=行政例会简报&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', document_number);
            form.append("source", "gw")

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData) {
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var html_str = `
                        <div style="width: 100%;height: 40px;line-height: 40px;">
                            <div style="width: 79%;height: 100%;display: inline-block;vertical-align: top;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                                <a target='_blank' href="`+JsonData["pdf_path"][i]["pdf_path"]+`">`+JsonData["file_name"]+`</a>
                            </div>
                            <div onclick="RemoveTr(this, '`+JsonData["pdf_path"][i]["id"]+`')" style="width: 18%;height: 100%;display: inline-block;vertical-align: top;text-align: center;font-size: 12px;cursor: pointer;color: red;">
                                删除
                            </div>
                        </div>
                    `
                    $("#upload_file_list").append(html_str)
                }
            } else {
                html_str = `
                    <div style="width: 100%;height: 40px;line-height: 40px;">
                        <div style="width: 79%;height: 100%;display: inline-block;vertical-align: top;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                            <a target='_blank' href="`+JsonData["pdf_path"]+`">`+JsonData["file_name"]+`</a>
                        </div>
                        <div onclick="RemoveTr(this, '`+JsonData["id"]+`')" style="width: 18%;height: 100%;display: inline-block;vertical-align: top;text-align: center;font-size: 12px;cursor: pointer;color: red;">
                            删除
                        </div>
                    </div>
                `
                $("#upload_file_list").append(html_str)
            }
        }

        function RemoveTr(_this, wj_id) {
            //当前节点的父亲
            var parentNode = _this.parentNode;
            parentNode.remove()

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
             };
        }

        // 公文详情页撤回、终止、作废操作
        function operate_button(ele_id) {
            var url = window.location.href;
            var id = url.split("id=")[1];
            console.log(ele_id)
            if (ele_id === 'is_stop') {
                var state = 'stop';     // 终止
                var word = '终止'
            } else if (ele_id === 'is_cancel') {
                state = 'cancel';       // 作废
                word = '作废'
            } else{
                state = 'recall'
                word = '撤回'
            }
            var r = confirm('是否'+word+'流程？')
            if (r == true) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/administrative/conference_memo_cancel_view", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("state=" + state + "&id=" + id)
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            alert(JsonDate['message'])
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd="
                        }
                    }
                };
            }
        }

        function onclick_upload_file() {
            document.getElementById("regular_main_body").click();
        }

        function scrollConversationScreen() {
            $('#selected-div').scrollTop($('#selected-div')[0].scrollHeight);
        }

        // 完结流程
        function end_flow(flow_id) {
            document.getElementById("appave-model").style.display = "table-cell";
            document.getElementById("flow-back").style.display = "none";
            document.getElementById("opinion_detail").setAttribute("placeholder", "完结理由");
            document.getElementById("flow-agree").setAttribute("onclick", "submit_flow()");
        }

        function submit_flow() {
            var opinion_detail = document.getElementById("opinion_detail").value;
            if (!opinion_detail) {
                alert("请填写完结理由！")
                return false
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personal-center/end_flows");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id={{ con_obj.id }}&end_reason=" + String(opinion_detail));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("操作成功！");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }
    </script>
{% endblock %}
